package com.igeek.javase.ch03.extendss;

/*
 *@author wangpeng
 *2023/7/12 19:33
 *@description TODO
 */

    public class Worker extends Person {
        //属性
        private String typework;

        public Worker() {
        }

        public Worker(String name, int age, char gender, String typework) {
            //super() 调用父类的构造方法
            super(name, age, gender);
            this.typework = typework;
        }

        public String getTypework() {
            return typework;
        }

        public void setTypework(String typework) {
            this.typework = typework;
        }

        //方法
        public void introduce(){
            System.out.println(this.getName()+"的工种是"+typework);
        }
    }

